package com.net.xpay.common.manager.impl.openapi;

import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import com.net.common.dao.BasicMapper;
import com.net.xpay.common.dao.openapi.OpenImageMapper;
import com.net.xpay.common.domain.openapi.OpenImage;
import com.net.xpay.common.manager.openapi.OpenImageManager;
import com.net.common.manager.AbstractManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


@Component
public class OpenImageManagerImpl extends AbstractManager<OpenImage> implements OpenImageManager{

    @Autowired
    private OpenImageMapper mapper;


    @Override
    protected BasicMapper<Long, OpenImage> getMapper() {
        return mapper;
    }

    @Override
    public OpenImage getByImageId(String imageId) {
        Preconditions.checkArgument(!Strings.isNullOrEmpty(imageId));
        OpenImage openImage = new OpenImage();
        openImage.setImageId(imageId);
        return getByCondition(openImage);
    }
}
